from .toolbar.floating_toolbar import FloatingToolbar
from .dockwidget.custom_dockwidget import CustomDockWidget
from .button.custom_toolbutton import CustomToolButton

class WidgetFactory:
    @staticmethod
    def create_toolbar(title, parent=None):
        """创建浮动工具栏"""
        return FloatingToolbar(parent)
    
    @staticmethod
    def create_dockwidget(title, widget=None, parent=None):
        """创建停靠窗口"""
        dock = CustomDockWidget(title, parent)
        if widget:
            dock.setWidget(widget)
        return dock
        
    @staticmethod
    def create_toolbutton(text="", icon=None, parent=None):
        """创建工具栏按钮"""
        return CustomToolButton(text, icon, parent) 